import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

/**
 * @author lizuhu
 * @description
 * @date 2021/8/31 9:36
 */
@Deprecated
public class ClientSend implements Runnable {
    private ObjectOutputStream oos;

    public ClientSend(ObjectOutputStream oos) {
        this.oos = oos;
    }

    @Override
    public void run() {
        send();
    }

    public void send() {
        try {
            Scanner scanner = new Scanner(System.in);
            while (true) {
                String msg = scanner.nextLine();
                oos.writeObject(msg);
                oos.flush();
                if (msg.equals("bye")) {
                    scanner.close();
                    break;
                }
            }
        } catch (Exception e) {
//            e.printStackTrace();
        }
    }
}
